﻿CREATE PROCEDURE [dbo].[wikiPages_update]
    @wikiPageId int = 0,
    @wikiCategoryId int,
    @pageName nvarchar(256),
    @content nvarchar(max),
    @creationDate datetime2,
    @publicUrl nvarchar(256)
AS
    UPDATE WikiPages
    SET 
        CategoryId = @wikiCategoryId,
        Name = @pageName,
        Content = @content,
        CreationDate = @creationDate,
        PublicUrl = @publicUrl
    WHERE WikiPages.PageId = @wikiPageId

    SELECT PageId, CategoryId, Name, Content, CreationDate, PublicUrl
    FROM WikiPages 
    WHERE WikiPages.PageId = @wikiPageId

RETURN 0
